/**
 * 
 */

/**
 * @author 
 * Yannic Remmet			196983
 * Tobias Trabelsi			197112
 * Anna-Katharina Wickert	197122
 */

public class TreeNode<T> {
	private TreeNode<T> left;
	private TreeNode<T> rigth;
	private T key;
	
	TreeNode(T k, TreeNode<T> l, TreeNode<T> r){
		key = k;
		left = l;
		rigth = r;
	}
	TreeNode(TreeNode<T> l, T k){
		key = k;
		left = l;
		rigth = null;
	}
	TreeNode(T k, TreeNode<T> r){
		key = k;
		left = null;
		rigth = r;
	}
	TreeNode(T k){
		key = k;
	}
	
	public T getKey(){
		return key;
	}
	public TreeNode<T> getLeft(){
		return left;
	}
	public TreeNode<T> getRight(){
		return rigth;
	}
	public TreeNode<T> setLeft(TreeNode<T> l){
		left = l;
		return left;
	}
	public TreeNode<T> setRight(TreeNode<T> l){
		rigth = l;
		return left;
	}
	public TreeNode<T> setKey (T o){
		key = o;
		return this;
	}
	public String toString(){
		return key.toString();
	}

}